﻿// Copyright (c) Inossem. All rights reserved.
// Licensed under the LGPL-3.0 license. See LICENSE file in the project root for full license information.
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DWF.Studio.Project
{
    /// <summary>
    /// 工程文件节点
    /// </summary>
    internal class ProjectFile : ProjectNode
    {
        /// <summary>
        /// 是否是启动项
        /// </summary>
        public bool IsStart
        {
            set;
            get;
        }

        /// <summary>
        /// 图标资源
        /// </summary>
        private static readonly Uri _fileIcon = new Uri("..\\Resources\\Treeview\\file.png", UriKind.Relative);

        public ProjectFile(bool isSelf = false)
        {
            this.NodeType = EProjectNodeType.File;
            this.IconLoc = _fileIcon;
            this.IsSelf = isSelf;
        }

        public override ObservableCollection<ProjectNode> Children
        {
            get
            {
                return null;
            } 
            set
            {
                throw new NotSupportedException();
            }
        }

        /// <summary>
        /// 扩展名
        /// </summary>
        public string Extension
        {
            get
            {
                return Path.GetExtension(this.FullName);
            }
        }
    }
}
